package cn.bxshey.resourceSharing.controller;

import cn.bxshey.resourceSharing.entity.HomeCarousel;
import cn.bxshey.resourceSharing.entity.R;
import cn.bxshey.resourceSharing.entity.Web;
import cn.bxshey.resourceSharing.service.WebService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @作者：不想说话而已
 * @Date：2024/1/7 1:03
 */

@RestController
@RequestMapping("/web")
public class WebController {

    @Resource
    WebService webService;

    @GetMapping("/{msg}")
    public R<?> get(@PathVariable("msg") String msg){
        if(msg.equals("home_carousel")){
            HomeCarousel homeCarousel1 = new HomeCarousel(1,"https://blog.lyzhnb.top/#/","https://www.lyzhnb.top/wf/snipaste20240107_100435.png","精美博客");
            HomeCarousel homeCarousel2 = new HomeCarousel(2,"30","https://www.lyzhnb.top/wf/wf-.jpg","超好玩的免费游戏");
            HomeCarousel homeCarousel3 = new HomeCarousel(3,"15","https://www.lyzhnb.top/wf/w-1.jpg","win7最新稳定版");
            HomeCarousel homeCarousel4 = new HomeCarousel(4
                    ,"9","https://www.lyzhnb.top/wf/adwawdadad.jpg","超好用的酷狗音乐");
            List<HomeCarousel> list = new ArrayList<>();
            list.add(homeCarousel1);
            list.add(homeCarousel2);
            list.add(homeCarousel3);
            list.add(homeCarousel4);
            return R.success(list);
        }
        return R.success();
    }

}
